#!/bin/bash

fdisk -l
echo "请输入所挂盘目标地址："
read -p "地址：" all
echo "请输入所挂地址："
read -p "地址：" ll
mkdir $ll
(
echo o
echo n
echo p
echo 1
echo  
echo  
echo w
) |fdisk $all
kk="${all}"
mkfs.ext4 $kk
mount $kk $ll
echo "$kk               $ll                   ext4    defaults        0 0">>/etc/fstab
df -h

echo "已实现永久挂载!!!"